
/*The following is a codebook description as well as statistical model code for:
Neiheisel, Jacob R. and Paul A. Djupe. Forthcoming. “Censor Morum? The 17th Amendment, 
	Religious Diversity, and Ideological Extremism in the Senate.” Political Research Quarterly 
*/
	
/*Variable Description
absvalDWNOM1 - Referred to as the absolute value and as folded DW-Nominate. It ranges from 0 (moderate) to 100 (extreme) using the first dimension of DW-N.
hmem - This is the herfindahl measure taken from religious censuses of 1890, 1906, 1916, 1926, and 1936. It is the sum of the squared proportions of each 
	denomination listed in the census for each state. Intercensal years are created by linear interpolation.
AmendInd - This is a dummy variable that is zero until 1912 and then is one beginning in 1914 after the passage of the 17th Amendment.
votesplit - A measure of state-level party competition collected from election returns archived by Dave Leip in his Atlas of U.S. Presidential Elections. 
	It is calculated as the absolute value of the GOP percentage of the two-party vote minus .5. 
pbl -  This is the party balance of the legislature divided by 1000 (so it ranges from 0-1). 
TimeTrend - ranges from 1-24 covering the years included in the sample.
aw - Is the Sullivan index of diversity in the state. It includes proportion native born, foreign born, homeowners, urban, and manufacturing jobs that have 
	been squared and summed and divided by the number of groups (5)(as with a herfindahl index). 
sitting - captures whether the senator was newly elected (0) or an incumbent (1). 
South - a South dummy including the former Confederate states.
GovAppoint - a dummy that captures whether a senator was appointed to the seat by the state's governor (from CQ's Guide to U.S. Elections)
*/

*The following code recreates the analyses in the paper.
*Table 1 and Figure 3
xtreg absvalDWNOM1 c.hmem##i.AmendInd votesplit pbl TimeTrend aw, fe vce(robust) vsquish
xtreg absvalDWNOM1 c.hmem##i.AmendInd votesplit pbl TimeTrend aw if PresidentialYear==1, fe vce(robust)  vsquish


*Table 2
xtreg absvalDWNOM1 c.hmem##c.TimeTrend votesplit pbl aw if year>1912, fe vce(robust) vsquish
xtreg absvalDWNOM1 c.hmem##c.TimeTrend votesplit pbl aw if PresidentialYear==1 & year>1912, fe vce(robust)  vsquish


*Table A1 - Method of Selection
xtreg absvalDWNOM1 i.AmendInd##c.hmem sitting votesplit pbl TimeTrend aw if PresidentialYear==1 & GovAppoint<1, fe vce(robust) vsquish
xtreg absvalDWNOM1 i.AmendInd##c.hmem sitting votesplit pbl TimeTrend aw if GovAppoint<1, fe vce(robust) vsquish


*Figure A1
xtreg absvalDWNOM1 i.AmendInd##c.hmem##i.sitting TimeTrend votesplit pbl aw if GovAppoint<1, fe vce(robust)


*Figure A2
xtreg absvalDWNOM1 i.AmendInd##c.hmem##i.South TimeTrend votesplit pbl aw , re vce(robust)

